Skip to content

Enable coverage when testJvm same as Gradle Daemon JDK or with checkCoverage property#11764

Open
bric3 wants to merge 5 commits into
masterfrom
bdu/enable-coverage-when-asked-for-it
Open

Enable coverage when testJvm same as Gradle Daemon JDK or with checkCoverage property#11764
bric3 wants to merge 5 commits into
masterfrom
bdu/enable-coverage-when-asked-for-it

Conversation

@bric3

@bric3 bric3 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Coverage is now enabled if the testJvm matches the daemon JDK (as before), but now also when explicitly requested via checkCoverage property which is consulted when the aggregate test task is being configured, but never was in the test jvm build extension.

Note

You can consider this as a hotfix, because checkCoverage is somewhat an unrelated property to the test jvm constraints plugin, it is a CI concern.
At some point this might be refactored to a place with the proper scoped concerns.

Motivation

Code coverage was explicitly disabled when the testJvm was run on a different JDK.

Coverage was disabled as a side effect of the old multi-JDK test optimization.

When -PtestJvm was introduced, the intent was to run the same Gradle Test tasks on another JDK instead of creating separate test tasks per JDK. For those additional JVM runs, Jacoco was explicitly disabled to avoid paying coverage instrumentation cost across the whole compatibility matrix. That made sense when coverage was expected to run only once, on the normal/base test JVM.

The problem is that CI later also passed -PtestJvm=8 to the coverage job. While that was mostly harmless, once the daemon moved to a newer JDK, Java 21, the gitlab-ci condition if [ "$testJvm" == "8" ]; then export GRADLE_PARAMS="-PskipFlakyTests -PcheckCoverage"; fi was applied, but then made the Java 8 a real test launcher. Which then deactivated jacoco.

Additional Notes

Instrumentations were deliberately not covered by jacoco, so only base_tests job is affected.

History of related changes

Coverage fix PRs

@bric3 bric3 added type: bug Bug report and fix tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling labels Jun 29, 2026
@datadog-official

datadog-official Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 54.94%

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 277da81 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.76 s 14.75 s [-0.7%; +0.8%] (no difference)
startup:insecure-bank:tracing:Agent 13.71 s 13.61 s [-0.3%; +1.7%] (no difference)
startup:petclinic:appsec:Agent 16.92 s 16.78 s [-0.2%; +2.0%] (no difference)
startup:petclinic:iast:Agent 16.91 s 16.91 s [-0.8%; +0.9%] (no difference)
startup:petclinic:profiling:Agent 16.87 s 17.00 s [-2.1%; +0.7%] (no difference)
startup:petclinic:sca:Agent 16.86 s 16.62 s [+0.7%; +2.3%] (maybe worse)
startup:petclinic:tracing:Agent 16.11 s 16.12 s [-0.9%; +0.7%] (no difference)

Commit: 277da817 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@bric3 bric3 marked this pull request as ready for review June 30, 2026 09:00
@bric3 bric3 requested a review from a team as a code owner June 30, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: no release notes Changes to exclude from release notes type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants